package pack0710.com;

import java.util.Objects;

public class Disk {

    private int id;

    private String name ;

    private boolean status = true ;   //true表示可以借阅的

    public Disk(){}

    public Disk(int id, String name) {
        this.id = id ;
        this.name = name ;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return id+ "\t" + name + "\t" + (status?"可以借阅":"已借走");
    }

    @Override
    public boolean equals(Object o) {
        Disk disk = (Disk) o;
        return id == disk.id ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, status);
    }
}
